<%@page pageEncoding="utf-8" contentType="text/html; charset=utf-8"%>
<script type="text/javascript" src="dwr/interface/ExaminWFApprover.js"></script>

<div id="dlgLrShow" style="width:560px;display:none;">  	
	<table cellSpacing="1" cellPadding="0" width="100%" class="gridview" width="100%">
		<tr>
			<td width="15%"  class="tablefield">
				请假单编号
			</td>
			<td width="35%" style="word-break:break-all;">
				<label id="lr-lrNo"></label>
			</td>
			<td width="15%" class="tablefield">
				种类
			</td>
			<td width="35%" >
				<label id="lr-lrLtNo-ltName"></label>
			</td>
		</tr>
		<tr>
			<td class="tablefield">
				员工(编号)
			</td>
			<td>
				<label id="lr-lrEmpNo-empName"></label>
				(<label id="lr-lrEmpNo-empDistinctNo"></label>)
			</td>	
			<td class="tablefield" >
				所在部门
			</td>
			<td >
				<label id="lr-lrEmpDept-departmentName"></label>
			</td>
		</tr>
		<tr>
			<td  class="tablefield">
				开始时间
			</td>
			<td>
				<label id="lr-lrStartDate" ></label>
			</td>
			<td class="tablefield" >
				结束时间
			</td>
			<td >
				<label id="lr-lrEndDate" ></label>
			</td>
		</tr>
		<tr>
			<td  class="tablefield">
				总时间
			</td>
			<td>
				<label id="lr-lrTotalTime"></label>
			</td>
			<td class="tablefield" >
				状态
			</td>
			<td>
				<label id="lr-lrStatusMean"></label>
			</td>
		</tr>
		<tr>
			<td class="tablefield">
				创建时间
			</td>
			<td>
				<label id="lr-lrCreateBy-empName"></label>于<label id="lr-lrCreateTime"></label>
			</td>
			<td class="tablefield" >
				最后修改时间
			</td>
			<td>
				<label id="lr-lrLastChangeBy-empName"></label>于<label id="lr-lrLastChangeTime"></label>
			</td>
		</tr>
		<tr>
			<td class="tablefield" >
				请假理由
			</td>
			<td class="listView" colspan="3" >
				<label id="lr-lrReason"></label>
			</td>
		</tr>
		<tr>
			<td colspan="4" class="prompt_div_bottom">
				<input class="button" type="button" value="关闭" onclick="hrm.common.closeDialog('dlgLrShow');"/>
			</td>										
		</tr>
	</table>
</div>

<script type="text/javascript" language="javascript">  
 function ShowLR(lrid){  
  	ExaminWFApprover.getLRContext(lrid, showLr_callback);//dwr调用,获取请假单内容，lrid是请假单编号
	function showLr_callback(lr) { //回调函数(lr为请假单)
		if (lr==null) return; // 异常处理，请假单不存在，或权限不足
	
		if (lr.applyLRByDay && lr.lrStartApm != null) {
	 			lr.lrStartDate=lr.lrStartDate.toHRMDateString();
	 			lr.lrStartApm.toString()=="0"?(lr.lrStartDate+=" 上午"):(lr.lrStartDate+=" 下午");
	 		 	lr.lrEndDate = lr.lrEndDate.toHRMDateString();
	 		 	lr.lrEndApm.toString() == "0"?(lr.lrEndDate+=" 上午"):(lr.lrEndDate+=" 下午");
		} else {
 	 		lr.lrStartDate=lr.lrStartDate.toFormatString("yyyy-MM-dd hh:mm");
 			lr.lrEndDate=lr.lrEndDate.toFormatString("yyyy-MM-dd hh:mm");
 		}

		if (lr.applyLRByDay) {
 	 		lr.lrTotalTime=lr.lrTotalDays+" 天";
 	 	} else {
 			lr.lrTotalTime=lr.lrTotalHours+" 小时";
 	 	}

	 	lr.lrCreateTime=lr.lrCreateTime.toFormatString('yyyy-MM-dd hh:mm:ss');
 		lr.lrLastChangeTime=lr.lrLastChangeTime.toFormatString('yyyy-MM-dd hh:mm:ss');
 	 
		model.simple.initByObject("dlgLrShow","lr",lr);
 		
 		$("#dlgLrShow").dialog("option","title",'编号为'+lr.lrNo+'的请假单详细信息');
        hrm.common.openDialog('dlgLrShow');  
 	}
 } 
</script>